import { getScatter } from '@/api'
function data(obj, key) {
    return obj && obj[key] ? obj[key] : []
}
function dataObj(obj, key) {
    return obj && obj[key] ? obj[key] : {}
}
export default {
    data(){
        return {
            objs:{},
            objs2:[],
            arrays:[],
            aaa:[]
        }
    },
    computed: {
        
    },
    methods:{
        async getArr(){
            let res = await getScatter()
            this.objs = res.data.geo
            this.objs2 = res.data.data
            this.objs2.forEach(item=>{
                let obj = {}
                obj.name = item.name
                obj.value = [...this.objs[item.name],item.value]
                this.arrays.push(obj)
            })
            this.arrays.sort((a,b)=>{
                return b.value[2]-a.value[2]
            })
            this.aaa=this.arrays.slice(0,10)
        }
    },
    mounted(){
        this.getArr() 
    }
    
}